package org.convallaria.framework.swagger.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;

/**
 * Swagger配置属性
 * 
 * @author convallaria
 * @since 1.0.0
 */
@Data
@ConfigurationProperties(prefix = "convallaria.swagger")
public class SwaggerProperties {

    /**
     * 是否启用Swagger
     */
    private boolean enabled = true;

    /**
     * API标题
     */
    private String title = "Convallaria Backend API";

    /**
     * API描述
     */
    private String description = "Convallaria Backend 企业级微服务平台 API 文档";

    /**
     * API版本
     */
    private String version = "1.0.0";

    /**
     * 联系信息
     */
    private Contact contact = new Contact();

    /**
     * 许可证信息
     */
    private License license = new License();

    /**
     * 服务器列表
     */
    private List<Server> servers = List.of(
            new Server("http://localhost:8080", "开发环境"),
            new Server("https://api.convallaria.com", "生产环境")
    );

    @Data
    public static class Contact {
        private String name = "Convallaria Team";
        private String email = "support@convallaria.com";
        private String url = "https://www.convallaria.com";
    }

    @Data
    public static class License {
        private String name = "MIT License";
        private String url = "https://opensource.org/licenses/MIT";
    }

    @Data
    public static class Server {
        private String url;
        private String description;

        public Server() {}

        public Server(String url, String description) {
            this.url = url;
            this.description = description;
        }
    }
}
